From sean_montgomery at baseview.com Wed Feb 2 16:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed Feb 2 16:07:55 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 13:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed Feb 2 17:29:56 2005 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 18:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Feb 2 17:55:49 2005 Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj@www.linux.org.uk From david at holicow.com Fri Feb 4 19:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri Feb 4 19:54:13 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment.bin From sean_montgomery at baseview.com Fri Feb 4 20:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Feb 4 20:34:29 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment.bin From dmarkman at mac.com Fri Feb 4 21:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Feb 4 21:33:20 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 11:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun Feb 6 17:52:36 2005 Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 18:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun Feb 6 18:13:09 2005 Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj@www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 15:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon Feb 7 15:12:42 2005 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 17:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Feb 7 17:14:30 2005 Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj@www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 13:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue Feb 8 13:09:44 2005 Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 16:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Feb 8 16:08:40 2005 Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj@www.linux.org.uk From alex at hybrid-tech.homeip.net Wed Feb 9 05:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Wed Feb 9 06:04:16 2005 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Wed Feb 9 06:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Feb 9 06:21:57 2005 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 09:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Feb 9 09:42:11 2005 Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj@www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 11:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed Feb 9 11:49:06 2005 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 18:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Feb 9 18:50:12 2005 Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 20:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Feb 9 20:10:37 2005 Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 20:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed Feb 9 20:42:41 2005 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex@hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx@linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx@linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 23:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed Feb 9 23:52:17 2005 Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Thu Feb 10 01:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu Feb 10 01:02:04 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Thu Feb 10 02:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Feb 10 02:15:17 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Thu Feb 10 02:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu Feb 10 02:39:04 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj@www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: Java RXTX discussion <rxtx@linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx@linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx@linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-X-Sender: taj@parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760@phx.gbl> >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj@www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 08:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu Feb 10 08:04:48 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port.java -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test.java From vincent.ramp at opticon.com Thu Feb 10 08:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu Feb 10 08:42:55 2005 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment.htm From taj at www.linux.org.uk Thu Feb 10 09:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu Feb 10 08:59:34 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj@www.linux.org.uk From krishan at dkrz.de Thu Feb 10 09:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu Feb 10 09:12:14 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Fri Feb 11 00:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Feb 11 00:21:12 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx@linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Fri Feb 11 00:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Feb 11 00:43:50 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj@www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: Java RXTX discussion <rxtx@linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx@linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx@linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-X-Sender: taj@parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760@phx.gbl> >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj@www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 19:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Feb 15 19:26:23 2005 Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj@www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 21:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Thu Feb 17 12:39:51 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 13:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu Feb 17 13:16:18 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise@btinternet.com> >Reply-To: jonwise@btinternet.com,Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 16:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu Feb 17 16:28:29 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 19:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu Feb 17 19:23:19 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 20:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat Feb 19 20:31:00 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 22:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat Feb 19 22:20:52 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468@hotmail.com> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468@hotmail.com] >X-Sender: lau2468@hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx@linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 22:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Feb 19 22:22:08 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Sun Feb 20 03:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun Feb 20 03:10:50 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Mon Feb 21 01:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon Feb 21 01:22:44 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc@exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Mon Feb 21 05:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Mon Feb 21 05:09:33 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc@exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Mon Feb 21 05:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Feb 21 05:41:42 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 13:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon Feb 21 13:34:55 2005 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 21:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Feb 21 21:37:53 2005 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 21:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon Feb 21 21:40:04 2005 Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj@www.linux.org.uk From colinc at exsoft.com.au Tue Feb 22 02:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue Feb 22 02:52:24 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc@exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 07:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Feb 22 07:15:39 2005 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne@Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne@Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 09:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Feb 22 09:30:52 2005 Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne@Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne@Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj@www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0001.tar From waynetg at telkomsa.net Tue Feb 22 14:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Feb 22 14:38:15 2005 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 14:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue Feb 22 14:47:07 2005 Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 21:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Feb 22 21:02:58 2005 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne@Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 21:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Feb 22 21:08:54 2005 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 21:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Feb 22 21:23:29 2005 Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 21:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue Feb 22 21:40:54 2005 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne@Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne@Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 22:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Feb 22 22:07:02 2005 Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne@Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne@Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj@www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 07:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Thu Feb 24 07:46:10 2005 Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 10:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Feb 25 10:15:11 2005 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 19:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat Feb 26 19:11:15 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj@www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.electronpusher.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath.bin From dmarkman at mac.com Mon Feb 28 03:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Mon Feb 28 03:31:38 2005 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 16:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 13:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 18:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj@www.linux.org.uk From david at holicow.com Fri Feb 4 19:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0002.bin From sean_montgomery at baseview.com Fri Feb 4 20:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0002.bin From dmarkman at mac.com Fri Feb 4 21:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 11:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 18:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj@www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 15:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Fri Jun 3 17:46:58 2005 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 17:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj@www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 13:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 16:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj@www.linux.org.uk From alex at hybrid-tech.homeip.net Wed Feb 9 05:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Wed Feb 9 06:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 09:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj@www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 11:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 18:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 20:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 20:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex@hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx@linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx@linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 23:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Thu Feb 10 01:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Thu Feb 10 02:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Thu Feb 10 02:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:46:59 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj@www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: Java RXTX discussion <rxtx@linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx@linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx@linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-X-Sender: taj@parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760@phx.gbl> >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj@www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 08:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0002.java -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0002.java From vincent.ramp at opticon.com Thu Feb 10 08:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0002.htm From taj at www.linux.org.uk Thu Feb 10 09:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj@www.linux.org.uk From krishan at dkrz.de Thu Feb 10 09:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Fri Feb 11 00:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx@linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Fri Feb 11 00:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj@www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: Java RXTX discussion <rxtx@linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx@linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx@linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-X-Sender: taj@parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760@phx.gbl> >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj@www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 19:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj@www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 21:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 13:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Fri Jun 3 17:47:00 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise@btinternet.com> >Reply-To: jonwise@btinternet.com,Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 16:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 19:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 20:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 22:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468@hotmail.com> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468@hotmail.com] >X-Sender: lau2468@hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx@linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 22:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Sun Feb 20 03:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Mon Feb 21 01:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc@exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Mon Feb 21 05:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc@exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Mon Feb 21 05:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 13:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 21:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 21:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj@www.linux.org.uk From colinc at exsoft.com.au Tue Feb 22 02:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc@exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 07:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:01 2005 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne@Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne@Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 09:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne@Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne@Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj@www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0002.tar From waynetg at telkomsa.net Tue Feb 22 14:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 14:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 21:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne@Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 21:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 21:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 21:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne@Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne@Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 22:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne@Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne@Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj@www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 07:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 10:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 19:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj@www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0002.bin From dmarkman at mac.com Mon Feb 28 03:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 17:47:02 2005 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 16:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 13:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 18:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj@www.linux.org.uk From david at holicow.com Fri Feb 4 19:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0003.bin From sean_montgomery at baseview.com Fri Feb 4 20:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0003.bin From dmarkman at mac.com Fri Feb 4 21:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 11:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 18:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:21 2005 Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj@www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 15:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 17:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj@www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 13:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 16:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj@www.linux.org.uk From alex at hybrid-tech.homeip.net Wed Feb 9 05:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Wed Feb 9 06:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 09:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj@www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 11:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 18:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 20:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 20:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex@hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx@linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx@linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 23:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Thu Feb 10 01:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Thu Feb 10 02:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:22 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Thu Feb 10 02:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj@www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: Java RXTX discussion <rxtx@linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx@linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx@linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-X-Sender: taj@parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760@phx.gbl> >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj@www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 08:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0003.java -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0003.java From vincent.ramp at opticon.com Thu Feb 10 08:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0003.htm From taj at www.linux.org.uk Thu Feb 10 09:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj@www.linux.org.uk From krishan at dkrz.de Thu Feb 10 09:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Fri Feb 11 00:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx@linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Fri Feb 11 00:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj@www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: Java RXTX discussion <rxtx@linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx@linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx@linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-X-Sender: taj@parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760@phx.gbl> >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj@www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 19:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj@www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 21:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Fri Jun 3 18:09:23 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 13:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise@btinternet.com> >Reply-To: jonwise@btinternet.com,Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 16:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 19:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 20:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 22:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468@hotmail.com> >Reply-To: Java RXTX discussion <rxtx@linuxgrrls.org> >To: rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468@hotmail.com] >X-Sender: lau2468@hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx@linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx@linuxgrrls.org >Delivered-To: rxtx@linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx@linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx@linuxgrrls.org> >List-Help: <mailto:rxtx-request@linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request@linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces@linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces@linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 22:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj@www.linux.org.uk From lau2468 at hotmail.com Sun Feb 20 03:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Mon Feb 21 01:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc@exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Mon Feb 21 05:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc@exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Mon Feb 21 05:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj@www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 13:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 21:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 21:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj@www.linux.org.uk From colinc at exsoft.com.au Tue Feb 22 02:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Fri Jun 3 18:09:24 2005 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc@exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj@www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 07:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne@Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne@Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 09:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne@Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne@Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj@www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0003.tar From waynetg at telkomsa.net Tue Feb 22 14:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 14:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 21:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne@Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 21:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 21:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj@www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 21:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne@Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne@Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 22:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne@Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne@Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj@www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 07:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 10:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 19:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj@www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj@www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://pixie.strangenoises.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0003.bin From dmarkman at mac.com Mon Feb 28 03:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri Jun 3 18:09:25 2005 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0395.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0395.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0395.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0395.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0395.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0395.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0144.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0396.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0396.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0396.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0396.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0396.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0396.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0145.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0397.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0397.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0397.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0397.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0397.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0397.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0146.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0398.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0398.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0398.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0398.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0398.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0398.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0147.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0399.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0399.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0399.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0399.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0399.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0399.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0150.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0400.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0400.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0400.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0400.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0400.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0400.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0151.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0401.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0401.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0401.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0401.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0401.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0401.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0152.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0402.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0402.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0402.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0402.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0402.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0402.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0154.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0403.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0403.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0403.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0403.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0403.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0403.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0191.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0404.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0404.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0404.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0404.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0404.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0404.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0368.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0001.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0001.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0001.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0001.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0001.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0001.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0002.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0002.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0002.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0002.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0002.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0002.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0003.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0003.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0003.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0003.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0003.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0003.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0004.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0004.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0004.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0004.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0004.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0004.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0005.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0005.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0005.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0005.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0005.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0005.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0006.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0006.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0006.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0006.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0006.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0006.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0007.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0007.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0007.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0007.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0007.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0007.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0008.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0008.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0008.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0008.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0008.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0008.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0009.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0009.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0009.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0009.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0009.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0009.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0010.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0010.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0010.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0010.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0010.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0010.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0001.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0001.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0001.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0001.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0001.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0001.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0002.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0002.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0002.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0002.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0002.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0002.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0003.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0003.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0003.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0003.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0003.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0003.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0004.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0004.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0004.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0004.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0004.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0004.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0005.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0005.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0005.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0005.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0005.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0005.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0006.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0006.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0006.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0006.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0006.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0006.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0007.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0007.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0007.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0007.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0007.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0007.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0008.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0008.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0008.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0008.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0008.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0008.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0009.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0009.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0009.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0009.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0009.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0009.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0010.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0010.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0010.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0010.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0010.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0010.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0001.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0001.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0001.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0001.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0001.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0001.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0002.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0002.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0002.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0002.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0002.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0002.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0003.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0003.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0003.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0003.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0003.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0003.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0004.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0004.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0004.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0004.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0004.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0004.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0004.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0005.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0005.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0005.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0005.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0005.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0005.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0005.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0006.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0006.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0006.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0006.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0006.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0006.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0006.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0007.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0007.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0007.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0007.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0007.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0007.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0007.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0008.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0008.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0008.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0008.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0008.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0008.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0008.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0009.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0009.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0009.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0009.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0009.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0009.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0009.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0010.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0010.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0010.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0010.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0010.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0010.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0011.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0011.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0011.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0011.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0011.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0011.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0011.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0012.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0012.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0012.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0012.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0012.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0012.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0012.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0013.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0013.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0013.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0013.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0013.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0013.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0013.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0014.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0014.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0014.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0014.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0014.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0014.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0014.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0015.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0015.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0015.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0015.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0015.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0015.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0015.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0016.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0016.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0016.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0016.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0016.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0016.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0016.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0017.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0017.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0017.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0017.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0017.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 12:30:35 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx Message-ID: This is a really stange thing, my program alway throw this exception when the first time I ran it after my computer was first turn on. After that, if I kill the program and re-ran it, then everytimes works fine. Anyone have any ideas? Thanks in advance Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) at RS232Port.requestSignal(RS232Port.java:207) at RS232Port.getWeight(RS232Port.java:248) this is what I did in the program serial communication spec 600 bps, 7N2, initialize: device = "/dev/ttyS0"; owner = "myPogram"; while (portList.hasMoreElements() ) { identifier = (CommPortIdentifier) portList.nextElement(); //Found the desired port or //use the first avaliable port if not specified if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL && identifier.getName().equals(device) || device.equals("") ) { found = true; try { sPort = (SerialPort) identifier.open(owner, 2000); is = sPort.getInputStream(); os = sPort.getOutputStream(); sPort.setSerialPortParams(bauds, databits, stopbits, paritybits); sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); sPort.setRTS(false); error = OPEN_SUCCESSED; } catch (PortInUseException e) { error = OPEN_FAILED; break; } catch (UnsupportedCommOperationException e) { error = UNSUPPORTED_PARAM; break; } catch (IOException e) { error = IO_ERROR; break; } break; //already have what I wanted, don't need to go // through other ports ..... private String requestSignal(int nRequest) { byte[] readBuffer = new byte[14]; int offset = 0; int nRead = 0; int nByte = 0; boolean timeout = false; boolean reset = false; TimeOut to = new TimeOut(2000); to.start(); while (nRead < nRequest) { if (!to.isAlive() ) { timeout = true; break; } else { writeToPort( (byte) 0x64); try { Thread.sleep(280); //must wait for a while otherwise will throw some else //in SerialImp.c }catch(InterruptedException e) { reset = true; } try { nByte = is.available(); while (nByte > 0) { int n = is.read(readBuffer, offset, nByte); nRead += n; offset += nRead; nByte -= n; } //end while } catch (IOException e) { reset = true; } } } //end while nRead if (!timeout && !reset ) { to.interrupt(); return (new String(readBuffer) ); } else { try { if (os != null) os.close(); if (is != null) is.close(); os = sPort.getOutputStream(); is = sPort.getInputStream(); } catch (IOException e) { return UNSTABLE; } return UNSTABLE; } } //end requestSignal() ***************************************** public String getWeight() { String[] weight = new String[3]; boolean stable = false; int i = 0; TimeOut to = new TimeOut(2000); to.start(); while (to.isAlive() ) { weight[i] = requestSignal(14); if ( i++ == 3) i = 1; if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) && !weight[0].equals(UNSTABLE) ) { stable = true; to.interrupt(); break; } } //end while if (stable) return weight[0].substring(4, 9); else return UNSTABLE; } //end getWeight() ***************************** private void writeToPort(byte b) { try { os.write(b); } catch (IOException e) { } } //end writeToPort I compile from source using version rxtx2.1 - pre17 which java - /usr/jdk1.5.0_01/bin/java From lau2468 at hotmail.com Sat Feb 19 15:20:03 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 14:20:03 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut In-Reply-To: Message-ID: I implemented a work around, catch the exception and reinitialize the port. After the port had been reinitialized, everythings works fine. >From: "Alex Lau" <lau2468 at hotmail.com> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOutOfBoundsEx >Date: Sat, 19 Feb 2005 12:30:35 -0800 >MIME-Version: 1.0 >X-Originating-IP: [24.84.40.170] >X-Originating-Email: [lau2468 at hotmail.com] >X-Sender: lau2468 at hotmail.com >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc11-f16.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sat, 19 Feb 2005 12:32:29 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 5682F744EA; Sat, 19 Feb 2005 20:31:05 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id A658E73F0D;Sat, 19 Feb 2005 20:30:59 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id C9939733D4; Sat, 19 Feb 2005 20:30:57 +0000 (GMT) >Received: from hotmail.com (bay18-f31.bay18.hotmail.com [65.54.187.81])by mail.linuxgrrls.org (Postfix) with ESMTP id 8B3627324Efor <rxtx at linuxgrrls.org>; Sat, 19 Feb 2005 20:30:56 +0000 (GMT) >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;Sat, 19 Feb 2005 12:31:07 -0800 >Received: from 24.84.40.170 by by18fd.bay18.hotmail.msn.com with HTTP;Sat, 19 Feb 2005 20:30:35 GMT >X-Message-Info: QIy1oIULmHcGnq6pbeRH8I74I6hqY//H+xQHJmfNjCE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-OriginalArrivalTime: 19 Feb 2005 20:31:07.0680 (UTC)FILETIME=[F0F1BA00:01C516C1] >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org > >This is a really stange thing, my program alway throw this exception >when the first time I ran it after my computer was first turn on. >After that, if I kill the program and re-ran it, then everytimes >works fine. > >Anyone have any ideas? Thanks in advance > >Exception in thread "AWT-EventQueue-0" >java.lang.IndexOutOfBoundsException > at >gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > >this is what I did in the program serial communication spec 600 bps, >7N2, > >initialize: > >device = "/dev/ttyS0"; >owner = "myPogram"; > >while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > >..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will >throw some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > >} //end requestSignal() >***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() >***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > >I compile from source using version rxtx2.1 - pre17 >which java - /usr/jdk1.5.0_01/bin/java > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sat Feb 19 15:22:17 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 19 Feb 2005 22:22:17 +0000 (GMT) Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsEx In-Reply-To: References: Message-ID: On Sat, 19 Feb 2005, Alex Lau wrote: > This is a really stange thing, my program alway throw this exception when > the first time I ran it after my computer was first turn on. After that, if > I kill the program and re-ran it, then everytimes works fine. > > Anyone have any ideas? Thanks in advance > > Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException > at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1321) > at RS232Port.requestSignal(RS232Port.java:207) > at RS232Port.getWeight(RS232Port.java:248) > > > this is what I did in the program serial communication spec 600 bps, 7N2, > > initialize: > > device = "/dev/ttyS0"; > owner = "myPogram"; > > while (portList.hasMoreElements() ) { > identifier = (CommPortIdentifier) portList.nextElement(); > //Found the desired port or > //use the first avaliable port if not specified > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(device) > || device.equals("") ) { > found = true; > > try { > sPort = (SerialPort) identifier.open(owner, 2000); > > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > > sPort.setSerialPortParams(bauds, databits, > stopbits, paritybits); > sPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > sPort.setRTS(false); > > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > > ..... > private String requestSignal(int nRequest) { > byte[] readBuffer = new byte[14]; > int offset = 0; > int nRead = 0; > int nByte = 0; > boolean timeout = false; > boolean reset = false; > TimeOut to = new TimeOut(2000); > > to.start(); > > while (nRead < nRequest) { > > if (!to.isAlive() ) { > timeout = true; > break; > } else { > writeToPort( (byte) 0x64); > > try { Thread.sleep(280); //must wait for a while otherwise will throw > some else > > //in SerialImp.c > }catch(InterruptedException e) { > reset = true; > } > > try { > nByte = is.available(); > while (nByte > 0) { > int n = is.read(readBuffer, offset, nByte); > nRead += n; > offset += nRead; > nByte -= n; > > } //end while > } catch (IOException e) { > reset = true; > } > > } > } //end while nRead > > if (!timeout && !reset ) { > to.interrupt(); > return (new String(readBuffer) ); > } else { > try { > if (os != null) os.close(); > if (is != null) is.close(); > os = sPort.getOutputStream(); > is = sPort.getInputStream(); > } catch (IOException e) { return UNSTABLE; } > > return UNSTABLE; > } > > } //end requestSignal() > ***************************************** > public String getWeight() { > > String[] weight = new String[3]; > boolean stable = false; > int i = 0; > > TimeOut to = new TimeOut(2000); > > to.start(); > > while (to.isAlive() ) { > weight[i] = requestSignal(14); > if ( i++ == 3) i = 1; > if ( weight[0].equals(weight[1]) && weight[1].equals(weight[2]) > && !weight[0].equals(UNSTABLE) ) { > stable = true; > to.interrupt(); > break; > } > } //end while > > if (stable) > return weight[0].substring(4, 9); > else return UNSTABLE; > > } //end getWeight() > ***************************** > private void writeToPort(byte b) { > try { > os.write(b); > } catch (IOException e) { } > > } //end writeToPort > > > I compile from source using version rxtx2.1 - pre17 > which java - /usr/jdk1.5.0_01/bin/java > > The first time only? What is probably happening is no serial ports are enumerating. RXTX tries to do a timed out read on each possible serial port after reading. I'm suspicious of a udev or hald with this report. udev creates the /dev/ttyS* device files. Hal is a hardware abstraction layer. There is a great deal of change going on in recent distros here. What distro and version is this? Are /dev/ttyS* there after a clean boot? As the device file appears to have different behavior depending upon which time you try to access it, I dont think this is a rxtx bug (though you could check for the case of no ports being enumerated). This may be a bug that needs to be filed with the distribution. I dont have a system setup to test hal/udev properly. Thats usually two of the first things I cut out of a distro. As a workaround, you could try doing something like this in your /etc/rc.d/init.d/S99local or like initscript: for i in 1 2 3 4;do /bin/setserial -z /dev/ttyS$i autoconfig;done Just to force some access to the ports. It zeros the parameters and then configures the ports ewith defaults. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Sat Feb 19 20:10:17 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sat, 19 Feb 2005 19:10:17 -0800 Subject: [Rxtx] rxtx causing Exception in thread "AWT-EventQueue-0"java.lang.IndexOut Message-ID: Thanks for the reply, I am using FC3 system. I agree with you, I cannot really keep up with all the changes in side the linux kernel and ways of doing things. I do not know whether it is a good thing or not. I have to unlearn once in a while. I implemented a work around, in my application program, I caught the exception and reinitialise the serial port again and it works. From colinc at exsoft.com.au Sun Feb 20 18:23:00 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Mon, 21 Feb 2005 12:23:00 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502210123.RAA08258@wells.cisco.com> I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while successfully but have come across a problem. When I open the port and start sending information the port hangs on write if nothing is plugged in. I can't find any way to determine if something has been plugged in or not ? I tried running the cvs snapshot from the website but received various class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If this has been fixed on the new version I'll have a go at building it on jdk1.4.2, if not is there any techniques to get around the problem ? Thanks, Colin Canfield ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 From lau2468 at hotmail.com Sun Feb 20 22:09:22 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Sun, 20 Feb 2005 21:09:22 -0800 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> Message-ID: I hava a similiar problem with Fedora FC3, but it only happened the first time after a clean boot. Actually it was an uncaught exception. If this is the same problem, you can catch the exception and reinitialize the port. If it is not the same problem, may be you can use a time out, when time expire, you can interrupted the write thread and return. Hope this can help > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while >successfully but have come across a problem. When I open the port and start >sending information the port hangs on write if nothing is plugged in. I >can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various >class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If >this has been fixed on the new version I'll have a go at building it on >jdk1.4.2, if not is there any techniques to get around the problem ? > >Thanks, Colin Canfield > >---------------------------------------------------------------------------- >----- >Colin Canfield >Explorative Software Pty Ltd >colinc at exsoft.com.au >Internet Consultant >0412 197 943 >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Sun Feb 20 22:42:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 05:42:11 +0000 (GMT) Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: <200502210123.RAA08258@wells.cisco.com> References: <200502210123.RAA08258@wells.cisco.com> Message-ID: On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a while > successfully but have come across a problem. When I open the port and start > sending information the port hangs on write if nothing is plugged in. I > can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received various > class loader errors (presumably as I am running jdk1.4.2 not jdk1.5). If > this has been fixed on the new version I'll have a go at building it on > jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk From jsahn at connectedsys.com Mon Feb 21 06:35:52 2005 From: jsahn at connectedsys.com (Jisung, Ahn) Date: Mon, 21 Feb 2005 22:35:52 +0900 Subject: [Rxtx] Is RXTX support USB-to-Serial converter? Message-ID: <4219E3B8.6020900@connectedsys.com> I use 'ATEN''s USB to Serail conveter. I work well with minicom on Linux (Intel p-4) It is available at /dev/ttyUSB0 But I can't use is with Java COMM( with RXTX) try { CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); } catch (NoSuchPortException ex) { ex.printStackTrace(); } Is rxtx support USB-to-Serial? From taj at www.linux.org.uk Mon Feb 21 14:38:19 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:38:19 +0000 (GMT) Subject: [Rxtx] Is RXTX support USB-to-Serial converter? In-Reply-To: <4219E3B8.6020900@connectedsys.com> References: <4219E3B8.6020900@connectedsys.com> Message-ID: On Mon, 21 Feb 2005, Jisung, Ahn wrote: > I use 'ATEN''s USB to Serail conveter. > I work well with minicom on Linux (Intel p-4) > > It is available at /dev/ttyUSB0 > > But I can't use is with Java COMM( with RXTX) > > try { > CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0"); > } catch (NoSuchPortException ex) { > ex.printStackTrace(); > } > > > Is rxtx support USB-to-Serial? USB works with a slight alteration. We will probably do this modification by default next release as USB-to-Serial is becomming fairly common. The fix is mentioned here. You can also use symbolic links from the USB device file to say /dev/ttyS5. http://marc.theaimsgroup.com/?l=rxtx&m=104333984815758&w=2 -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Feb 21 14:40:43 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 21 Feb 2005 21:40:43 +0000 (GMT) Subject: [Rxtx] Windows XPSP2 USB drivers and hardware/software flow control Message-ID: Vincent Ramp dropped a message conerning flow control with XPSP2 and rxtx. It appears that USB serial on XP has some issues with flow control in older Windows kernel drivers but not newer Windows kernel drivers. These drivers can be updated from Microsoft over the Internet and are not always on the machine just because you have SP2 installed. -- Trent Jarvi taj at www.linux.org.uk From colinc at exsoft.com.au Mon Feb 21 19:52:59 2005 From: colinc at exsoft.com.au (Colin Canfield) Date: Tue, 22 Feb 2005 13:52:59 +1100 Subject: [Rxtx] Serial port hangs on write with no attatch devices In-Reply-To: Message-ID: <200502220253.SAA06031@wells.cisco.com> The isCD called fixed the problem, thanks! Colin ---------------------------------------------------------------------------- ----- Colin Canfield Explorative Software Pty Ltd colinc at exsoft.com.au Internet Consultant 0412 197 943 -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Monday, 21 February 2005 4:42 PM To: Java RXTX discussion Subject: Re: [Rxtx] Serial port hangs on write with no attatch devices On Mon, 21 Feb 2005, Colin Canfield wrote: > I have been using RXTX (2.1-7 pre 17 ) on mac and windows for a > while successfully but have come across a problem. When I open the > port and start sending information the port hangs on write if nothing > is plugged in. I can't find any way to determine if something has been plugged in or not ? > > I tried running the cvs snapshot from the website but received > various class loader errors (presumably as I am running jdk1.4.2 not > jdk1.5). If this has been fixed on the new version I'll have a go at > building it on jdk1.4.2, if not is there any techniques to get around the problem ? > > Thanks, Colin Canfield > "the port hangs on write" I don't think timeouts will help with write. They would help with read. Perhaps you can check if the port is connected with serial.isCD()? CD = Carrier Detect. This would not work if you are trying to use two wires instead of the complete DB9 connection. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From waynetg at telkomsa.net Tue Feb 22 00:16:14 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 09:16:14 +0200 Subject: [Rxtx] Compile errors with 2.1.6 Message-ID: <200502220916.14833.waynetg@telkomsa.net> Hi all I'm giving up on my amd64 installation (for a while) and trying a 32bit chroot/install. I've moved back to the last release 2.1.6 but I can't compile the code. Configure goes through successfully but make fails with the following error... [wayne at Wuler:i686]make make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed by `all'. Stop. and in 64 bit [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Any ideas why it would do this? Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 02:31:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 09:31:33 +0000 (GMT) Subject: [Rxtx] Compile errors with 2.1.6 In-Reply-To: <200502220916.14833.waynetg@telkomsa.net> References: <200502220916.14833.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I'm giving up on my amd64 installation (for a while) and trying a 32bit > chroot/install. I've moved back to the last release 2.1.6 but I can't compile > the code. Configure goes through successfully but make fails with the > following error... > > [wayne at Wuler:i686]make > make: *** No rule to make target `i686-pc-linux-gnu/librxtxSerial.la', needed > by `all'. Stop. > > and in 64 bit > > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Any ideas why it would do this? > You might try a script like do32. The attached tar has the scripts to do this. Building 32bit on 64 bit is a little interesting. The above can be untared in your home directory then just make sure ~/bin is in your path. I think you would just do: tar -xzvf rxtx-2.6....tar.gz cd rxtx-2.6... mkdir build cd build export PATH=~/bin:$PATH do32 configure do32 make install The cvs files for 64bit should work. I had them working with blackbox and things looked OK on a dual opteron. 32bit on 64 bit should work to with the above hack. But 2.1.6 as 64 bit is going to blow up for sure. What did you see that was wrong with the cvs tarballs on the download page with your 64 bit native system? Credit for the attached scripts goes to H. Peter Anvin. They also work nice for building i386 rpms on x86_64 on Fedora. -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: do32.tar Type: application/x-tar Size: 10240 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050222/23c764e1/do32-0017.tar From waynetg at telkomsa.net Tue Feb 22 07:39:02 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 16:39:02 +0200 Subject: [Rxtx] CVS compilation Message-ID: <200502221639.02244.waynetg@telkomsa.net> Hi all I've tried to download and install from the CVS following the instructions found on the net but all I get is the version of rxtx that needs suns comm download. Have I missed something? I'm trying to download the gnu.io version for amd64 Cheers Wayne From lmromena at yahoo.com Tue Feb 22 07:47:56 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 22 Feb 2005 06:47:56 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050222144757.705.qmail@web51704.mail.yahoo.com> Hello again, Sorry for my late reply. I took some break configuring my PC application and focused for the meantime at my mobile (client) application. Now, I am back at doing my server application to make my system work (hopefully). Anyway, I did what you said on your response (please see a copy of your message below) and upon executing the commands, I came up with these output: ls -ld /var/lock drwxrwxr-x 8 root lock 4096 Feb 22 20:55 /var/lock ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Feb 22 20:55 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 24 2004 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Feb 24 2004 /dev/ttyS2 crw-rw---- 1 root uucp 4, 67 Feb 24 2004 /dev/ttyS3 crw-rw---- 1 root uucp 4, 68 Feb 24 2004 /dev/ttyS4 crw-rw---- 1 root uucp 4, 69 Feb 24 2004 /dev/ttyS5 crw-rw---- 1 root uucp 4, 70 Feb 24 2004 /dev/ttyS6 crw-rw---- 1 root uucp 4, 71 Feb 24 2004 /dev/ttyS7 crw-rw---- 1 root uucp 4, 72 Feb 24 2004 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 24 2004 /dev/ttyS9 So based on this, I modified the file /var/lock and under the lock from something like this lock:x:54: to something like this lock:x:54:uname (I think this is the solution you're suggesting ^_^) After which, I can run the SerialDemo included in the commapi package (I'll try the other demos later). I'm glad that it works (for now) Thank you very much for your help!! I really appreciate it. ^_^ =========================== On February 8, you wrote: I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Tue Feb 22 14:03:52 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:03:52 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work Message-ID: <200502222303.52790.waynetg@telkomsa.net> Hi I've got my program working at last out of a 32bit chroot using the javax.comm libraries and the CVS implementation of rxvt(probably unnecessary. With respect to the rxtx libraries, my program does the following 1) identify ports 2) open ports 3) Initialises (GSM) modem to output all incomming traffic to the pipe 4) Sets up an action listener for all event coming from the modem 5) puts the thread into a loop 6) Event listener processes the data and sends it to mysql db. Here are the outcomes from various combinations of arch,kernel and jdk x86,2.6.9 kernel,javax.comm success x86_86,2.6.9 kernel.javax.comm Dies a horrible death with the following output java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory thrown while loading gnu.io.RXTXCommDriver Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: /opt/blackdown-jdk-1.4.2.01/jre/lib/amd64/librxtxSerial.so: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at za.co.terico.trawler.BaseStation.BaseStation.main(BaseStation.java:55) I have verified that none of the links are broken, recompiling in the 64 bit env fails with the following error [wayne at Wuler:x86_64]make /opt/blackdown-jdk-1.4.2.01/bin/javac -classpath .:/home/wayne/rxtx-devel:/home/wayne/rxtx-devel/src:/opt/blackdown-jdk-1.4.2.01/jre/lib/ext/comm.jar -d /home/wayne/rxtx-devel/ -O /home/wayne/rxtx-devel/./src/Configure.java /home/wayne/rxtx-devel/./src/LPRPort.java /home/wayne/rxtx-devel/./src/RXTXCommDriver.java /home/wayne/rxtx-devel/./src/RXTXPort.java /home/wayne/rxtx-devel/./src/RXTXVersion.java /home/wayne/rxtx-devel/./src/UnSupportedLoggerException.java /home/wayne/rxtx-devel/./src/Zystem.java Error: Class gnu.io.ParallelPort could not be found. make: *** [/home/wayne/rxtx-devel/gnu/io/Configure.class] Error 15 *shrug* x86,2.6.9 kernel,gnu.io event listener fails to report events :( and so no input can be processed. x86,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. All of the above observations were made using the latest available downloads, since 3.1.6 wouldn't compile on my machine (see earlier post). All of the above problems were experienced using Gentoo Linux. I hope all this info is useful to someone... I'm just glad that I've got something working :) Cheers Wayne From waynetg at telkomsa.net Tue Feb 22 14:09:50 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:09:50 +0200 Subject: [Rxtx] Some observations while trying to get rxtx to work In-Reply-To: <200502222303.52790.waynetg@telkomsa.net> References: <200502222303.52790.waynetg@telkomsa.net> Message-ID: <200502222309.50842.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:03, Wayne Gemmell wrote: > x86,2.6.9 kernel,javax.comm > Thread dies while trying to initialise modem. Sorry, this should read x86_64,2.6.9 kernel,javax.comm Thread dies while trying to initialise modem. From taj at www.linux.org.uk Tue Feb 22 14:24:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 21:24:20 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502221639.02244.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > Hi all > > I've tried to download and install from the CVS following the instructions > found on the net but all I get is the version of rxtx that needs suns comm > download. Have I missed something? I'm trying to download the gnu.io version > for amd64 > These are linked on the ftp page but the way rxtx.org works its a bit obscure what the actual URL is: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz The bins only has the i686 linux and w32 libraries. I could compile them easily for you if you like. -- Trent Jarvi taj at www.linux.org.uk From waynetg at telkomsa.net Tue Feb 22 14:41:48 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Tue, 22 Feb 2005 23:41:48 +0200 Subject: [Rxtx] CVS compilation In-Reply-To: References: <200502221639.02244.waynetg@telkomsa.net> Message-ID: <200502222341.48286.waynetg@telkomsa.net> On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > These are linked on the ftp page but the way rxtx.org works its a bit > obscure what the actual URL is: > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > The bins only has the i686 linux and w32 libraries. ?I could compile them > easily for you if you like. Thanks, maybe that would be the solution... I don't understand where these problems are coming from... I tried to compile the CVS and [wayne at Wuler:x86_64]./configure ... no visible problems ~/Recent Downloads/rxtx-2.1-CVS-20050120 [wayne at Wuler:x86_64]make make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', needed by `all'. Stop. Boom, no dice... Cheers Wayne From taj at www.linux.org.uk Tue Feb 22 15:07:55 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 22 Feb 2005 22:07:55 +0000 (GMT) Subject: [Rxtx] CVS compilation In-Reply-To: <200502222341.48286.waynetg@telkomsa.net> References: <200502221639.02244.waynetg@telkomsa.net> <200502222341.48286.waynetg@telkomsa.net> Message-ID: On Tue, 22 Feb 2005, Wayne Gemmell wrote: > On Tuesday 22 February 2005 23:24, Trent Jarvi wrote: > > These are linked on the ftp page but the way rxtx.org works its a bit > > obscure what the actual URL is: > > > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120.tar.gz > > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz > > > > The bins only has the i686 linux and w32 libraries. ?I could compile them > > easily for you if you like. > Thanks, maybe that would be the solution... I don't understand where these > problems are coming from... I tried to compile the CVS and > > [wayne at Wuler:x86_64]./configure > ... no visible problems > > ~/Recent Downloads/rxtx-2.1-CVS-20050120 > [wayne at Wuler:x86_64]make > make: *** No rule to make target `x86_64-unknown-linux-gnu/librxtxSerial.la', > needed by `all'. Stop. > > Boom, no dice... > I just slipstreamed the bins into the tarball so if you download it again it will have the binaries. I also included a copy of the Makefile generated so you can look at the differences. No modifications had to be done here. I do build with an older 2.4 kenrel but otherwise a very current system. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From aozoren at yahoo.com Thu Feb 24 00:25:21 2005 From: aozoren at yahoo.com (ali ozoren) Date: Wed, 23 Feb 2005 23:25:21 -0800 (PST) Subject: [Rxtx] rxtx on os x problem Message-ID: <20050224072521.34064.qmail@web60310.mail.yahoo.com> Hi - I'm getting the following error on OS X but I couldn't find the exact source of the binary I am using so I couldn't debug inside rxtx. I hope you can shed a light on the problem. I am able to read from /dev/usbserial0 otherwise using Java on OS X. Thanks, ali java.lang.NullPointerException at javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) at javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) at org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From waynetg at telkomsa.net Fri Feb 25 03:16:45 2005 From: waynetg at telkomsa.net (Wayne Gemmell) Date: Fri, 25 Feb 2005 12:16:45 +0200 Subject: [Rxtx] Manipulating fis Message-ID: <200502251216.45077.waynetg@telkomsa.net> Hi all Could anyone point me in the direction of docs pertaining to updating FIS images programatically? Maybe an API? Cheers Wayne From taj at www.linux.org.uk Sat Feb 26 12:11:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 26 Feb 2005 19:11:14 +0000 (GMT) Subject: [Rxtx] RXTX Patch for Libraries on Classpath (fwd) Message-ID: Anyone have a problem these changes? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 26 Feb 2005 13:53:17 -0500 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Patch for Libraries on Classpath Hi, Included is a patch file that allows the libaries (e.g librxtxSerial.so or rxtxSerial.dll) to be loaded from the classpath instead of having to be included in java.library.path. I am using RXTX for my senior project but didn't have access to install the libraries so I created this little fix. I hope others can find it useful. -Chris Gaffney Grand Valley State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath.patch Type: text/x-patch Size: 5613 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050226/6ce96c71/libraries_on_classpath-0017.bin From dmarkman at mac.com Sun Feb 27 20:32:00 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Sun, 27 Feb 2005 22:32:00 -0500 Subject: [Rxtx] rxtx on os x problem In-Reply-To: References: Message-ID: <7ee0a53707aac6cc05491891156bda38@mac.com> it looks like you use very old rxtx version currently RXTXPort class belongs to the gnu.io package on both 2.0 or 2.1 version On Feb 24, 2005, at 2:25 AM, Java RXTX discussion wrote: > Hi - I'm getting the following error on OS X but I > couldn't find the exact source of the binary I am > using so I couldn't debug inside rxtx. I hope you can > shed a light on the problem. I am able to read from > /dev/usbserial0 otherwise using Java on OS X. > Thanks, > ali > > > java.lang.NullPointerException > ????????at > javax.comm.RXTXPort$MonitorThread.access$002(RXTXPort.java:782) > ????????at > javax.comm.RXTXPort.notifyOnDataAvailable(RXTXPort.java:553) > ????????at > org.jsmsengine.CSerialDriver.open(CSerialDriver.java:108) > > > > > > > ??????????????? > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 250MB free storage. Do more. Manage less. > http://info.mail.yahoo.com/mail_250 > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From sean_montgomery at baseview.com Wed Feb 2 09:14:21 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Wed, 2 Feb 2005 11:14:21 -0500 Subject: [Rxtx] OS X 10.3.7 and 2.0-7pre1 - high CPU usage? In-Reply-To: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> References: <2e416d442ab6d5935b4c51d8d23bb185@baseview.com> Message-ID: Finally got around to building 2.0-7pre2, and read() works great - no more high CPU usage. Life is good :-) From jayant28k at gmail.com Wed Feb 2 06:15:06 2005 From: jayant28k at gmail.com (Jayant Kawadkar) Date: Wed, 2 Feb 2005 18:45:06 +0530 Subject: [Rxtx] Serial Port not found Message-ID: <6a6a023105020205155e2b57b8@mail.gmail.com> Hello Everyone, I trying the samples programs which in Java Communication Api on Mandrake10. When run the SimpleRead.java in Samples. I get the following error : port /dev/ttyS1 not found. I have changed the ttyS1 to ttyS1 also. And still I'm getting the same error. So his is far from my limited knowledge. Welcome any idea. Thanks in advance. Thanks Jayant From taj at www.linux.org.uk Wed Feb 2 11:02:26 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 2 Feb 2005 18:02:26 +0000 (GMT) Subject: [Rxtx] Serial Port not found In-Reply-To: <6a6a023105020205155e2b57b8@mail.gmail.com> References: <6a6a023105020205155e2b57b8@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005, Jayant Kawadkar wrote: > Hello Everyone, > > I trying the samples programs which in Java Communication > Api on Mandrake10. When run the SimpleRead.java in Samples. > I get the following error : > > port /dev/ttyS1 not found. > > I have changed the ttyS1 to ttyS1 also. And still I'm getting the > same error. So his is far from my limited knowledge. Welcome > any idea. Thanks in advance. > Hi Jayant You probably need to add the user to group lock. See sections C and R in the INSTALL file: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7pre17/INSTALL -- Trent Jarvi taj at www.linux.org.uk From david at holicow.com Fri Feb 4 12:12:49 2005 From: david at holicow.com (David Sargent) Date: Fri, 4 Feb 2005 12:12:49 -0700 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application Message-ID: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> I have compiled rxtx-2.1-CVS-20050120 on my system and it generated the following: librxtxSerial.jnilib RXTXcomm.jar I then placed them in the path /Library/Java/Extensions/. CommPortIdentifier.getPortIdentifiers finds the port I am looking for. But when I try to open it I get an error: Log: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Found port: /dev/tty.USA19H4b31P1.1 openError: gnu.io.PortInUseException: Unknown Application from the line of code: serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); What am I doing wrong? I search the list but could not find anything about this. Thanks David -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 975 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/ee6fdd10/attachment-0018.bin From sean_montgomery at baseview.com Fri Feb 4 13:41:39 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 4 Feb 2005 15:41:39 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: Unknown Application In-Reply-To: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> References: <3c64055ec984041824c6d856dfaaaf2e@holicow.com> Message-ID: Hello, Some other app has opened the port and won't relinquish ownership to you. Is it possible you've got that port open in another app like ZTerm or some other terminal program? Keyspan supplies a Keyspan Serial Assistant utility program with most of their serial to USB devices - does it give your adapter a clean bill of health? On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > librxtxSerial.jnilib > RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050204/e491f7db/attachment-0018.bin From dmarkman at mac.com Fri Feb 4 14:40:27 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 4 Feb 2005 16:40:27 -0500 Subject: [Rxtx] OSX 10.3.7, rxtx-2.1-CVS-20050120, ERROR: gnu.io.PortInUseException: U In-Reply-To: References: Message-ID: <306ba24d835aacfef7488653e77cf030@mac.com> why not to use mac os x installer? many people use it without any problem. did you set all your environment? I mean permissions, groups e.t.c? On Feb 4, 2005, at 3:41 PM, Java RXTX discussion wrote: > ?Hello, > Some other app has opened the port and won't relinquish ownership to > you. ?Is it possible you've got that port open in another app like > ZTerm or some other terminal program? > > Keyspan supplies a Keyspan Serial Assistant utility program with most > of ?their serial to USB devices - does it give your adapter a clean > bill of health? > > On Feb 4, 2005, at 2:12 PM, David Sargent wrote: > > I have compiled rxtx-2.1-CVS-20050120 on my system and it generated > the following: > ????????librxtxSerial.jnilib > ????????RXTXcomm.jar > I then placed them in the path /Library/Java/Extensions/. > > > CommPortIdentifier.getPortIdentifiers finds the port I am looking for. > ?But when I try to open it I get an error: > > Log: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version ??= RXTX-2.1-7pre20 > Found port: /dev/tty.USA19H4b31P1.1 > openError: gnu.io.PortInUseException: Unknown Application > > from the line of code: > ???????? ???serialPort = (SerialPort) portId.open("SimpleReadApp", > 2000); > > > What am I doing wrong? I search the list but could not find anything > about this. > > Thanks > > David > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From lmromena at yahoo.com Sun Feb 6 04:53:38 2005 From: lmromena at yahoo.com (Lester Romena) Date: Sun, 6 Feb 2005 03:53:38 -0800 (PST) Subject: [Rxtx] rxtx / commapi installation Message-ID: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Hello everyone, I would like to ask for some installation notes regarding rxtx version 2.0. It seems like the tar file doesn't have a readme file that will guide the user (esp. those that are not yet experts like me) throughout the installation process. By the way, I am using Fedora Core 2 as my OS bundled with J2SE 1.5. I will be using serial port programming to communicate with my mobile phone via Bluetooth as my thesis. A step-by-step guide (via reply or a link to it) will be greatly appreciated. I have seen some links before posting but it seems that it is applicable to older versions. Actually, I have already installed it but when I run an application (like the SimpleWriter from Java communications API download), I get a message like this: caught java.lang.NoClassDefFoundError: javax/comm/CommDriver while loading driver gnu.io.RXTXCommDriver Again, thanks in advance. __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 From taj at www.linux.org.uk Sun Feb 6 11:13:16 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 6 Feb 2005 18:13:16 +0000 (GMT) Subject: [Rxtx] rxtx / commapi installation In-Reply-To: <20050206115339.74927.qmail@web51704.mail.yahoo.com> References: <20050206115339.74927.qmail@web51704.mail.yahoo.com> Message-ID: On Sun, 6 Feb 2005, Lester Romena wrote: > Hello everyone, > > I would like to ask for some installation notes > regarding rxtx version 2.0. It seems like the tar file > doesn't have a readme file that will guide the user > (esp. those that are not yet experts like me) > throughout the installation process. > > By the way, I am using Fedora Core 2 as my OS bundled > with J2SE 1.5. I will be using serial port programming > to communicate with my mobile phone via Bluetooth as > my thesis. A step-by-step guide (via reply or a link > to it) will be greatly appreciated. I have seen some > links before posting but it seems that it is > applicable to older versions. Actually, I have already > installed it but when I run an application (like the > SimpleWriter from Java communications API download), I > get a message like this: caught > java.lang.NoClassDefFoundError: javax/comm/CommDriver > while loading driver gnu.io.RXTXCommDriver > > Again, thanks in advance. > > > The Document you want is INSTALL which comes in the source tarball. For everything except windows, the source tarball is probably easier to install. -- Trent Jarvi taj at www.linux.org.uk From phofstetter at sensational.ch Mon Feb 7 08:13:02 2005 From: phofstetter at sensational.ch (Philip Hofstetter) Date: Mon, 07 Feb 2005 16:13:02 +0100 Subject: [Rxtx] Prolific USB2Serial Adaptor Message-ID: <4207857E.2000204@sensational.ch> Hello, I'm having some problems "talking" to a USB2Serial-Adaptor with a Prolific chipset under Windows: As soon as I'm calling [outputStream].flush(), an IOException "Input/output error in writeArray" is thrown. I have no problems connecting to the same device when using the native serial port. Any ideas? Can I enable some debugging-mode? Thank you! Philip From taj at www.linux.org.uk Mon Feb 7 10:14:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 7 Feb 2005 17:14:52 +0000 (GMT) Subject: [Rxtx] Prolific USB2Serial Adaptor In-Reply-To: <4207857E.2000204@sensational.ch> References: <4207857E.2000204@sensational.ch> Message-ID: On Mon, 7 Feb 2005, Philip Hofstetter wrote: > Hello, > > I'm having some problems "talking" to a USB2Serial-Adaptor with a > Prolific chipset under Windows: > > As soon as I'm calling [outputStream].flush(), an IOException > "Input/output error in writeArray" is thrown. > > I have no problems connecting to the same device when using the native > serial port. > > Any ideas? Can I enable some debugging-mode? > Hi Philip This is very interesting but I dont have a solution at this point. Here are my suspicions but I will be looking at this in more detail as this is a very important part of CommAPI. There may be a bug in rxtx but follow along if you will. UARTs (chips/hardware) have a register that shows how many bytes remain to be written. So deep in the windows/linux/.. driver code, one can look and see when all of the bytes have been written. The fun stuff kernel hackers love. But in your case there is no UART. The driver is (poorly?) trying to pretend it is the UART. Just to be clear, this problem is probably underneath rxtx not in rxtx. The Mac OS X kernel drivers do this right somehow. This is really important in CommAPI. One of the key concepts in CommAPI is output buffer empty events. So somehow this imaginary UART is supposed to have a register that does not exist and CommAPI is supposed to tell many important applications when this happens. I'll probably have a software fix to get you past this in a month or so but I'm not sure I'll be able to fix the underlying problem which is probably a bit more complex than you expected. For RXTX this is really important as many computers in the future will not have a UART. -- Trent Jarvi taj at www.linux.org.uk From lmromena at yahoo.com Tue Feb 8 06:10:16 2005 From: lmromena at yahoo.com (Lester Romena) Date: Tue, 8 Feb 2005 05:10:16 -0800 (PST) Subject: [Rxtx] Re: rxtx / commapi installation Message-ID: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Hello, Thank you for your immediate response. I have followed your advice to install the libraries using the source tarball, but at the moment, I'm still having problems regarding lock files. I have read from the INSTALL file that the /etc/group file must be modified where there is a line about uucp. This is how it looks like before modification: uucp:x:14:uucp,nut since my username is "lester" I appended it to become like this one: uucp:x:14:uucp,nut,lester After saving and rebooting, I tried again to run the sample programs included with the commapi of Sun. It still displayed that I do not have permission to create a lock file. Any solution/suggestions that will solve this problem is greatly appreciated. By the way, if I use the root account to run the sample programs, it just displays that /dev/ttyS0 file already exists. But still, I can run it using other available serial ports. Again, thank you in advance. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From taj at www.linux.org.uk Tue Feb 8 09:09:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 8 Feb 2005 16:09:14 +0000 (GMT) Subject: [Rxtx] Re: rxtx / commapi installation In-Reply-To: <20050208131016.22982.qmail@web51701.mail.yahoo.com> References: <20050208131016.22982.qmail@web51701.mail.yahoo.com> Message-ID: On Tue, 8 Feb 2005, Lester Romena wrote: > Hello, > > Thank you for your immediate response. I have > followed your advice to install the libraries using > the source tarball, but at the moment, I'm still > having problems regarding lock files. I have read from > the INSTALL file that the /etc/group file must be > modified where there is a line about uucp. This is how > it looks like before modification: > > uucp:x:14:uucp,nut > > since my username is "lester" I appended it to become > like this one: > > uucp:x:14:uucp,nut,lester > > After saving and rebooting, I tried again to run the > sample programs included with the commapi of Sun. It > still displayed that I do not have permission to > create a lock file. Any solution/suggestions that will > solve this problem is greatly appreciated. > > By the way, if I use the root account to run the > sample programs, it just displays that /dev/ttyS0 file > already exists. But still, I can run it using other > available serial ports. > > Again, thank you in advance. > > > I suspect you need to add the user to group lock. See which group owns the lock directory. ls -ld /var/lock/ drwxrwxr-x 6 root lock 4096 Feb 8 04:02 /var/lock/ -------------------^^^^ Also check the permissions and group ownership of the device files: ls -l /dev/ttyS? crw-rw---- 1 root uucp 4, 64 Aug 31 13:37 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Aug 31 13:37 /dev/ttyS1 crw-rw---- 1 root uucp 4, 66 Aug 31 13:37 /dev/ttyS2 -------------------^^^^ So on this machine, group uucp can open the port and group lock can create lockfiles. -- Trent Jarvi taj at www.linux.org.uk From alex at hybrid-tech.homeip.net Tue Feb 8 22:41:59 2005 From: alex at hybrid-tech.homeip.net (Alex) Date: Tue, 08 Feb 2005 21:41:59 -0800 Subject: [Rxtx] rxtx - no port found Message-ID: <1107927719.5028.19.camel@localhost.localdomain> Hi Trent: I compiled and install the 2.0-7pre 2 version of rxtx on two of my Fedora core 3 machines. One works fine ,but the other one can never find any ports (serial / parallel). I tried the sample from commapi but alway receive no port found message. I tried to re-compile with --enable-DEBUG but no error message was created. My machine's serial port is working fine when I run my another c program. I also changed the permission of /dev/ttyS0 to 666 and try to use java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port found message. which java /usr/bin/java java version - 1.4.2 autoconf version - 2.5.9 uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux automake --version 1.9.2 libtool --version 1.5.6 make --version GNU Make 3.80 Thanks in advance Hi Alex What happens if you try to run the application as root? Usually what happens is there is a mistake and the user is not in the lock group. Root should be able to find the port if my suspicion is correct. As the user you could be able to do the following: (cd /var/lock && touch a_filename && rm -f a_filename) Thats more or less what rxtx does with lock files. So see if you can do that. The kernel header warning is probably not an issue. Its just saying those headers are not the same headers the kernel was compiled with. Many distros ship seperate include files. As a user you should be able to do: echo 1 > /dev/ttyS1 cat /dev/ttyS1 You will probably get io errors but not permission denied errors. Let me know how things go and we can figure out whats up. There was another post concerning rxtx with groups uucp and lock on the rxtx mail list today. http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 Hi Trent: Thanks for your prompt reply! I tried to run the application as root but the same result, no port found!. I also follow the suggestion in the INSTALL file and the post in the mail list about the lock file but still no luck. also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 does work without error. Hi Alex. You certainly can post to the mail-list. Maybe someone has seen the problem to. Could you look in /var/lock and make sure there is not a lockfile in that directory? Try fuser /dev/ttyS0 to see if something has the port open. Maybe you have another software mentioned above for testing sitting around that has locked the port. For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx will not be able to open that port. You could even try switching to runlevel 1 so you are sure no other applications are running and see if that solves the problem. A lock file will look like /var/lock/LCK..ttyS0 and will contain the PID of the process that has the port open. You can also bypass lockfiles by running configure --disable-lockfiles, recompile and install. I suspect gpm, minicom, kermit, ... something like that has the port and you need to close that application. Hi fuser /dev/ttyS0 returns nothing, re-compile library with --disable-lockfiles and recompile application produces same result -No port found! Anybody have any insight? Thanks in advance! From taj at www.linux.org.uk Tue Feb 8 23:22:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 06:22:40 +0000 (GMT) Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> References: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: On Tue, 8 Feb 2005, Alex wrote: > Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never > find any ports (serial / parallel). I tried the sample from commapi but > alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. > Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can > do that. The kernel header warning is probably not an issue. Its just > saying those headers are not the same headers the kernel was compiled > with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on > the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > > Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port > found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > > also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > > Hi Alex. You certainly can post to the mail-list. Maybe someone has > seen > the problem to. > > Could you look in /var/lock and make sure there is not a lockfile in > that > directory? Try > > fuser /dev/ttyS0 > > to see if something has the port open. Maybe you have another software > mentioned above for testing sitting around that has locked the port. > > For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx > will not be able to open that port. You could even try switching to > runlevel 1 so you are sure no other applications are running and see if > that solves the problem. > > A lock file will look like > > /var/lock/LCK..ttyS0 > > and will contain the PID of the process that has the port open. > > You can also bypass lockfiles by running configure --disable-lockfiles, > recompile and install. > > I suspect gpm, minicom, kermit, ... something like that has the port and > you need to close that application. > > > Hi > > fuser /dev/ttyS0 returns nothing, > re-compile library with --disable-lockfiles and recompile application > produces same result -No port found! > > Anybody have any insight? > > Thanks in advance! > I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 02:42:57 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 09:42:57 +0000 (GMT) Subject: [Rxtx] Some success with jre-1.4.2gcj4 Message-ID: I followed up on this to see how things are. ----------------------------------------------------------------------- I'm curious. /usr/bin/java... thats not usually where Java from IBM, Sun or Blackdown is installed. FC has libgcj/gij which is probably that java. Just looking at a install of fc-devel here, /usr/bin/java is a symbolic link to /etc/alternatives/java which is a symbolic link to /usr/lib/jvm/jre-1.4.2gcj4/bin/java. Thats probably what you are running. I'm not sure anyone has run rxtx with that java yet. There could be problems that I'm not aware of. You could try installing one of the other javas, placing the bin directory at the front of your path and try that. We will have to examine this new Java on FC in more detail. ------------------------------------------------------------------------ gcj4 compat is working with rxtx. I'm not sure where the native library should end up with this configuration but it does work. This is just a modem pcmcia card with no line connected. java -fullversion && java SimpleRead /dev/ttyS3 java full version "gcj-1.4.2" Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS3 --> atz <-- atz OK --> atdxxxxx <-- atd021891383 Dial Error... http://gcc.gnu.org/java -- Trent Jarvi taj at www.linux.org.uk From roberto.tavares at gmail.com Wed Feb 9 04:49:55 2005 From: roberto.tavares at gmail.com (Roberto Tavares) Date: Wed, 9 Feb 2005 09:49:55 -0200 Subject: [Rxtx] How can I distribuite it? Message-ID: <8d442b380502090349408cd93a@mail.gmail.com> Hello, I got a "real cool and modest" aplication in JAVA that uses rxtx. Now, I need to sent it to a friend. On my computer, I have: libSolarisSerialParallel.so on /usr/lib commapi/comm.jar on ext directory of my JRE and I have installed rxtx from cvs. I have a "myclass.class" that do all the serial stuff (and uses rxtx). How can I distribuite it? Is possible to use it as a jar file, assuming that he uses the same Linux as I am using? Thanks! Roberto From taj at www.linux.org.uk Wed Feb 9 11:51:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 18:51:03 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc Message-ID: As mentioned earlier, mark and space parity are not working in recent glibc based systems. At least Linux. Maybe others. Rxtx used to include which defines CMSPAR used for mark and space parity. The problem with doing this is termbits.h defines a termios.h structure of a different size than the one found in termios.h causing memory problems. User space should not need to directly include anything in asm/ directly so I assume this problem is in included by . I have filed a bug with a potential fix at redhat's bugzilla as they appear to do the bugzilla for upstream glibc in hopes that a general fix can get upstream. In the past, we used to bug the kernel develpers and try to get the termios structure ifdefed __kernel__ so we could include termbits.h directly but this is problematic as the ifdef keeps vanishing. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 The proposed fix follows. --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 @@ -172,6 +172,7 @@ #define __MAX_BAUD B4000000 #ifdef __USE_MISC # define CIBAUD 002003600000 /* input baud rate (not used) */ +# define CMSPAR 010000000000 /* mark or space (stick) parity */ # define CRTSCTS 020000000000 /* flow control */ #endif -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Feb 9 13:11:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 20:11:15 +0000 (GMT) Subject: [Rxtx] Re: RXTX & Gentoo & Digi One SP RealPort driver In-Reply-To: <420A688B.3080700@idessa.com> References: <420A688B.3080700@idessa.com> Message-ID: On Wed, 9 Feb 2005, Danny Morrow wrote: > Hi Trent, > > Perhaps you will be interested to know of my efforts to use RXTX in the > Gentoo environment to bridge an application I am writing to the Digi One > SP device and RealPort driver. > > I am currently attempting to use RXTX-2.1-7pre17 on a Gentoo machine, to > access both the standard /dev/ttyS0..3 ports and also additional > /dev/ttyS0..Infinity ports added by Digi International's ( > http://www.digi.com/products/externaldeviceservers/digionesp.jsp ) Digi > One SP devices coupled with their RealPort driver. > > When I run the PrettyPortLister (pg 505 of O'Reilly's "Java IO" book by > Elliotte Rusty Harold) after a successful installation of RXTX (copying > so's as root to $JAVA_HOME/jre/lib/i386 and the RXTXcomm.jar to > $JAVA_HOME/jre/lib/ext), I only have one device listed in the > Enumeration: /dev/ttyS0. That corresponds to the port that Windows > would call COM1. The library doesn't find the other two serial devices > available that I have that have DigiOne devices on them, which should be > /dev/ttyS1 and /dev/ttyS2. I can communicate with these devices from > this machine, using telnet and a loopback adapter, but not through RXTX > and my application code. > > I know I haven't subscribed to the RXTX mailing list yet, but I will > soon. I promise. Wow. Thats a goofy device. So this device plugs into your ethernet port and then does RS232 from there. Interesting. What will have to happen for rxtx to work with this is Digi Connectware is going to have to have a device driver that provides a tty to Linux. For usual ports this is /dev/ttyS0. When there are unusual devices or multiport cards, the devices provide a different device file like /dev/digi0. But I don't know what the device name is or if there is a kernel driver for Linux to provide this interface. If there is a device driver, you should be able to see a message when the ports are registered with dmesg as you insert the module. This device driver would have to handle all or most of the kernel level termios functions. When you find out what the device drivers are called you can just modify RXTXCommDriver.java to look for the new device. if (osName.equals ("Linux")) { String[]Temp = { "ttyS", // linux Serial Ports "digi", // assuming its /dev/digi[0-255] "ttySA" // for the IPAQs }; CandidatePortPrefixes = Temp; } RXTX should then enumerate the device if everything goes well. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 13:41:38 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 12:41:38 -0800 Subject: [Rxtx] rxtx - no port found In-Reply-To: <1107927719.5028.19.camel@localhost.localdomain> Message-ID: Yeah! I forgot to put the path of the jdk bin/java before the system's path to usr/bin/java. So everytime I use java, it use the one come with FC3. Now I am a happy man. I would like to thanks one more time for the wounder thanks from Trent. >From: Alex <alex at hybrid-tech.homeip.net> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx - no port found >Date: Tue, 08 Feb 2005 21:41:59 -0800 >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f42.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 8 Feb 2005 22:05:14 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 88343731E3; Wed, 9 Feb 2005 06:04:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 3817773242;Wed, 9 Feb 2005 06:04:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id AF03A73220; Wed, 9 Feb 2005 05:41:19 +0000 (GMT) >Received: from localhost.localdomain (S01060080c6ef6471.vc.shawcable.net[24.84.40.170])by mail.linuxgrrls.org (Postfix) with ESMTP id 4CA84731E3for <rxtx at linuxgrrls.org>; Wed, 9 Feb 2005 05:41:15 +0000 (GMT) >Received: from 192.168.0.149 ([192.168.0.149])by localhost.localdomain (8.12.10/8.12.10) with ESMTP id j194T772004217for <rxtx at linuxgrrls.org>; Tue, 8 Feb 2005 20:29:07 -0800 >X-Message-Info: P3NBY493gE77po4l4bTXSXYjuikVz6QU7RaCY7rlSAE= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-Mailer: Evolution 2.0.2 (2.0.2-3) >X-Mailman-Approved-At: Wed, 09 Feb 2005 06:04:15 +0000 >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 09 Feb 2005 06:05:15.0076 (UTC) FILETIME=[52A5F840:01C50E6D] > >Hi Trent: > I compiled and install the 2.0-7pre 2 version of rxtx on two of my > Fedora core 3 machines. One works fine ,but the other one can never >find any ports (serial / parallel). I tried the sample from commapi but >alway receive no port found message. > > I tried to re-compile with --enable-DEBUG but no error message was > created. My machine's serial port is working fine when I run my another > c program. > > I also changed the permission of /dev/ttyS0 to 666 and try to use > java -Dgnu.io.rxtx.SerialPorts=/dev/ttyS0 BlackBox, but still no port > found message. > > which java /usr/bin/java > java version - 1.4.2 > autoconf version - 2.5.9 > uname -a Linux localhost.localdomain 2.6.10-1.760_FC3 #1 Wed Feb 2 > 00:14:23 EST 2005 i686 athlon i386 GNU/Linux > automake --version 1.9.2 > libtool --version 1.5.6 > make --version GNU Make 3.80 > > Thanks in advance > > > Hi Alex > > What happens if you try to run the application as root? Usually what > happens is there is a mistake and the user is not in the lock group. >Root should be able to find the port if my suspicion is correct. > As the user you could be able to do the following: > (cd /var/lock && touch a_filename && rm -f a_filename) > > Thats more or less what rxtx does with lock files. So see if you can >do that. The kernel header warning is probably not an issue. Its just >saying those headers are not the same headers the kernel was compiled >with. Many distros ship seperate include files. > > As a user you should be able to do: > > echo 1 > /dev/ttyS1 > cat /dev/ttyS1 > > You will probably get io errors but not permission denied errors. > > Let me know how things go and we can figure out whats up. > > There was another post concerning rxtx with groups uucp and lock on >the > rxtx mail list today. > http://marc.theaimsgroup.com/?l=rxtx&m=110787898002760&w=2 > > Hi Trent: > >Thanks for your prompt reply! > > I tried to run the application as root but the same result, no port >found!. I also follow the suggestion in the INSTALL file and the post in > the mail list about the lock file but still no luck. > >also as user echo 1 > /dev/ttyS0 return without error and cat /dev/ttyS0 > does work without error. > > >Hi Alex. You certainly can post to the mail-list. Maybe someone has >seen >the problem to. > >Could you look in /var/lock and make sure there is not a lockfile in >that >directory? Try > > fuser /dev/ttyS0 > >to see if something has the port open. Maybe you have another software >mentioned above for testing sitting around that has locked the port. > >For instance, if you have minicom or gpm running on /dev/ttyS0, rxtx >will not be able to open that port. You could even try switching to >runlevel 1 so you are sure no other applications are running and see if >that solves the problem. > >A lock file will look like > >/var/lock/LCK..ttyS0 > >and will contain the PID of the process that has the port open. > >You can also bypass lockfiles by running configure --disable-lockfiles, >recompile and install. > >I suspect gpm, minicom, kermit, ... something like that has the port and >you need to close that application. > > >Hi > >fuser /dev/ttyS0 returns nothing, >re-compile library with --disable-lockfiles and recompile application >produces same result -No port found! > >Anybody have any insight? > >Thanks in advance! > > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Wed Feb 9 16:53:11 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 9 Feb 2005 23:53:11 +0000 (GMT) Subject: [Rxtx] Mark and Space Parity with glibc In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Trent Jarvi wrote: > > As mentioned earlier, mark and space parity are not working in recent > glibc based systems. At least Linux. Maybe others. > > Rxtx used to include which defines CMSPAR used for mark > and space parity. The problem with doing this is termbits.h defines a > termios.h structure of a different size than the one found in termios.h > causing memory problems. > > User space should not need to directly include anything in asm/ directly > so I assume this problem is in included by . > I have filed a bug with a potential fix at redhat's bugzilla as they > appear to do the bugzilla for upstream glibc in hopes that a general fix > can get upstream. > > In the past, we used to bug the kernel develpers and try to get the > termios structure ifdefed __kernel__ so we could include termbits.h > directly but this is problematic as the ifdef keeps vanishing. > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=147533 > > The proposed fix follows. > > --- bits/termios.h.orig 2005-02-08 14:57:52.000000000 -0700 > +++ bits/termios.h 2005-02-08 14:56:56.000000000 -0700 > @@ -172,6 +172,7 @@ > #define __MAX_BAUD B4000000 > #ifdef __USE_MISC > # define CIBAUD 002003600000 /* input baud rate (not used) */ > +# define CMSPAR 010000000000 /* mark or space (stick) parity */ > # define CRTSCTS 020000000000 /* flow control */ > #endif > > Jakub has compiled a more complete patch for multiple platforms and posted it to the glibc-hackers list. This is a good time to test the patch before it goes in upstream. Especially if you have non x86 hardware to test like alpha, powerpc or sparc as many feature set macro guards have been added from x86. http://sources.redhat.com/ml/libc-hacker/2005-02/msg00034.html https://bugzilla.redhat.com/beta/show_bug.cgi?id=147533 -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 18:01:39 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 17:01:39 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question Message-ID: When using the commAPI and when I need to open a serial port I have to do SerialPort sPort; CommPortIdentifier identifier; ... sPort = (SerialPort) identifier.open("MyApp", 2000); .... How inportant is the stirng argument, is it just any String or it has to be the name of the class where the main() resides. Or I can also do this sPort = (SerialPort) identifier.open(fd); how do I generate the file descriptor, or how do I check for avaliability of a file descriptor under java. Thanks in advance From taj at www.linux.org.uk Wed Feb 9 19:16:13 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: References: Message-ID: On Wed, 9 Feb 2005, Alex Lau wrote: > When using the commAPI and when I need to open a serial port I have to do > > SerialPort sPort; > CommPortIdentifier identifier; > ... > sPort = (SerialPort) identifier.open("MyApp", 2000); > .... > > How inportant is the stirng argument, is it just any String or it has to be > the name of the class where the main() resides. > > Or I can also do this > sPort = (SerialPort) identifier.open(fd); > how do I generate the file descriptor, or how do I check for avaliability of > a file descriptor under java. > > I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In rxtx 2.1 which you can download and look at, the method will just throw an UnsupportedCommOperationException. I'm not sure what Sun's code will do if you try it. The open("MyApp", 2000); approach is better. The string is just the name you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx wait()s after sending a OwnershipEvent to try to free up the port. So one of the things that could be implemented in the future is the ability for applications to request the Comm Ports from each other. If you want to deal with file descriptors, you can probably open the device file (/dev/ttyS0) and read/write to it. You will have little other control, the port will be at defaults (probably 9600,8,n,1 if the port has not been messed with). But in that case, you could do away with commapi completely. The normal way to use commapi is the open as mentioned and then get a inputstream, possibly a buffered inputstream and use that. The fd like you use in C programming is never used directly. I guess the difference in thinking is with C everything is a file/filedescriptor and with Java everything is an object/reference. So with Java you would learn the SerialPort class and the Input/OutputStreams rather than C functions like ioctl() that require a fd. There should be a SimpleRead.java in the contrib directory that gets input/output streams and is not too hard to follow. -- Trent Jarvi taj at www.linux.org.uk From lau2468 at hotmail.com Wed Feb 9 19:39:27 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Wed, 09 Feb 2005 18:39:27 -0800 Subject: [Rxtx] Basics in commAPI - this is not exactly a pure rxtx question In-Reply-To: Message-ID: Thanks, This is my first serious Java Application, I had been mainly doing c socket programming in the past so I am so exicted when I was told by the commAPI document that I can use file descriptor : ) >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Basics in commAPI - this is not exactly a pure rxtxquestion >Date: Thu, 10 Feb 2005 02:16:13 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by mc3-f3.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 9 Feb 2005 18:16:41 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id A749474640; Thu, 10 Feb 2005 02:15:21 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id BD849745A0;Thu, 10 Feb 2005 02:15:17 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 0D91C7340F; Thu, 10 Feb 2005 02:15:16 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id E8133732EBfor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 02:15:12 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1Cz3sM-0004yp-9xfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 02:16:14 +0000 >X-Message-Info: QIy1oIULmHduA69lWBglL7AS2ljGRyltaGtT0VV64hM= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F1160035686E063F037CC15BF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 02:16:44.0041 (UTC) FILETIME=[90A5CF90:01C50F16] > >On Wed, 9 Feb 2005, Alex Lau wrote: > > > When using the commAPI and when I need to open a serial port I have to do > > > > SerialPort sPort; > > CommPortIdentifier identifier; > > ... > > sPort = (SerialPort) identifier.open("MyApp", 2000); > > .... > > > > How inportant is the stirng argument, is it just any String or it has to be > > the name of the class where the main() resides. > > > > Or I can also do this > > sPort = (SerialPort) identifier.open(fd); > > how do I generate the file descriptor, or how do I check for avaliability of > > a file descriptor under java. > > > > > >I'm not sure how the Sun CommAPI wrapper classes handled open(fd). In >rxtx 2.1 which you can download and look at, the method will just throw an >UnsupportedCommOperationException. I'm not sure what Sun's code will do >if you try it. > >The open("MyApp", 2000); approach is better. The string is just the name >you pick as the owner for Comm Port Ownership. The 2000 is the time rxtx >wait()s after sending a OwnershipEvent to try to free up the port. So one >of the things that could be implemented in the future is the ability for >applications to request the Comm Ports from each other. > >If you want to deal with file descriptors, you can probably open the >device file (/dev/ttyS0) and read/write to it. You will have little other >control, the port will be at defaults (probably 9600,8,n,1 if the port has >not been messed with). But in that case, you could do away with commapi >completely. > >The normal way to use commapi is the open as mentioned and then get a >inputstream, possibly a buffered inputstream and use that. The fd like >you use in C programming is never used directly. I guess the difference >in thinking is with C everything is a file/filedescriptor and with Java >everything is an object/reference. So with Java you would learn the >SerialPort class and the Input/OutputStreams rather than C functions like >ioctl() that require a fd. > >There should be a SimpleRead.java in the contrib directory that gets >input/output streams and is not too hard to follow. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 01:04:40 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 00:04:40 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice Message-ID: I wrote a wrapper class for working with the serial port using commapi I also wrote a driver program to test the wrapper class. The hardware I used is a DMM with serial output with communication specification 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. The program suppose to send a 'd' to the DMM, read input from inputstream and display message to the console. But it does not work as expected. If anybody has some spare time, can you check the code in the attached files and give me some advices. Thanks in advance -------------- next part -------------- A non-text attachment was scrubbed... Name: RS232Port.java Type: text/x-java Size: 3322 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/RS232Port-0018.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Test.java Type: text/x-java Size: 602 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/3874f3a8/Test-0018.bin From vincent.ramp at opticon.com Thu Feb 10 01:40:41 2005 From: vincent.ramp at opticon.com (Vincent Ramp) Date: Thu, 10 Feb 2005 09:40:41 +0100 Subject: [Rxtx] Trouble exucuting program using RXTX Message-ID: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. I hope someone can help me with this. Thanks in advanced, Vincent Ramp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050210/2d6df46b/attachment-0018.html From taj at www.linux.org.uk Thu Feb 10 02:00:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: On Thu, 10 Feb 2005, Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware I used > is a DMM with serial output with communication specification 7,N,2 B600. To > recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from inputstream > and display message to the console. But it does not work as expected. > > If anybody has some spare time, can you check the code in the attached files > and give me some advices. > > Thanks in advance > > Is it 0x0d or 0x64 that you really want to send? See man ascii. There is an example program in contrib called SimpleSnuV1.java that sends specific bytes to a modem. Maybe you could start with getting that to talk to the DMM as a more simple test. Java Strings have 16 bit characters for Unicode. The translation to bytes depends upon a few things documented in the API documentation. -- Trent Jarvi taj at www.linux.org.uk From krishan at dkrz.de Thu Feb 10 02:12:37 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 10 Feb 2005 10:12:37 +0100 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: References: Message-ID: <420B2585.6060706@dkrz.de> Alex Lau wrote: > I wrote a wrapper class for working with the serial port using commapi > > I also wrote a driver program to test the wrapper class. The hardware > I used is a DMM with serial output with communication specification > 7,N,2 B600. To recieive a message, first send the DMM a 'd' command. > > The program suppose to send a 'd' to the DMM, read input from > inputstream and display message to the console. But it does not work > as expected. > > If anybody has some spare time, can you check the code in the attached > files and give me some advices. > > Thanks in advance > >------------------------------------------------------------------------ > >import javax.comm.*; >import java.io.*; >import java.util.*; > >public class RS232Port implements SerialPortEventListener { > public static final int OPEN_SUCCESSED = 0; > public static final int OPEN_FAILED = 1; > public static final int TOO_MANY_LISTENER = 2; > public static final int UNSUPPORTED_PARAM = 3; > public static final int IO_ERROR = 4; > > private CommPortIdentifier identifier; > private Enumeration portList; > > private SerialPort sPort; > > private int error; // show the status of the RS232Port > > private String sString; > > private InputStream is; > private OutputStream os; > > /*Constructor: > **String device identify the system device that > **the caller wants to open. > **In Windows COM0, COM1..etc > ** Linux /dev/ttyS0. /dev/ttyS1...etc > */ > public RS232Port(String Device, String OwnerName, int baud, > int databit, int stopbit, int parity) { > > sString = ""; > > //this shall get a list of RS232 port avaliable in the system > portList = CommPortIdentifier.getPortIdentifiers(); > > while (portList.hasMoreElements() ) { > //instantiate a CommPortIdentifier > identifier = (CommPortIdentifier) portList.nextElement(); > > if (identifier.getPortType() == CommPortIdentifier.PORT_SERIAL > && identifier.getName().equals(Device) ) { > System.out.println("Found my port :" + > identifier.getName() ); > try { > sPort = (SerialPort) identifier.open(OwnerName, 2000); > is = sPort.getInputStream(); > os = sPort.getOutputStream(); > sPort.addEventListener(this); > sPort.notifyOnDataAvailable(true); > sPort.setSerialPortParams(baud, databit, > stopbit, parity); > error = OPEN_SUCCESSED; > } catch (PortInUseException e) { > error = OPEN_FAILED; > break; > } catch (TooManyListenersException e) { > error = TOO_MANY_LISTENER; > break; > } catch (UnsupportedCommOperationException e) { > error = UNSUPPORTED_PARAM; > break; > } catch (IOException e) { > error = IO_ERROR; > break; > } > > break; //already have what I wanted, don't need to go > // through other ports > } //end if > > } //end while > > if (error != 0) PortClose(); //has error, close port > } > > } //end constructor > > public int getError() { return error; } > > public boolean hasError() { > if ( error != 0) > return true; > else return false; > } > > public void PortClose() { > if (sPort != null) { > try { > if (os != null) os.close(); > if (is != null) is.close(); > } catch (IOException e) { System.out.println(e); } > > sPort.close(); > } > } > > public void serialEvent(SerialPortEvent evt) { > switch (evt.getEventType() ) { > case SerialPortEvent.DATA_AVAILABLE: > byte[] readBuffer = new byte[14]; > > try { > while (is.available() > 0) { > int nByte = is.read(readBuffer); > } > sString = new String(readBuffer); > System.out.println("Reading " + sString); > } catch (IOException e) { > sString = "error in read"; > System.out.println("error in read"); > } > break; > default: > break; > } //end switch > } //end serialEvent > > public String toString() { return sString; } > > public void writeToPort(String buffer) { > try { > if (!buffer.equals("") ) { > os.write(buffer.getBytes() ); > } > } catch (IOException e) { } > > } //end writeToPort > >} //end class RS232Port > > > >------------------------------------------------------------------------ > >import javax.comm.*; > >public class Test { > > > public Test(String title) { > } > > public static void main(String[] args) { > > RS232Port port = new RS232Port("/dev/ttyS0", "Test", 600, > SerialPort.DATABITS_7, > SerialPort.STOPBITS_2, > SerialPort.PARITY_NONE); > > if (port.hasError() ) > System.out.print("error:\t" + port.getError() + "\n" ); > else { > System.out.print("No Error" + "\n"); > for (int i = 0; i <= 100; i++) { > port.writeToPort("d"); > try { > Thread.sleep(100); > } catch (InterruptedException e) {} > } > } > port.PortClose(); > } >} > > > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > Hello Alex, You seem to have one closing curly bracket at the end of the constructor of your RS232Port class that is one too much. Without removing that bracket actually you cannot compile that file. After removing that bracket I compiled both files attached to your message and ran Test.java as well . The message reported by it was: # java Test Found my port :/dev/ttyS0 No Error Is it what you expect without any device connected to the port? Gopal Krishan From lau2468 at hotmail.com Thu Feb 10 17:20:21 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:20:21 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: <420B2585.6060706@dkrz.de> Message-ID: Thanks for the reply, the only problem was that when the hardware was connected, no input can be read. I shall follow Trents advices and check into the wirite function. >>Rxtx mailing list >>Rxtx at linuxgrrls.org >>http://mailman.linuxgrrls.org/mailman/listinfo/rxtx >> >> >Hello Alex, > >You seem to have one closing curly bracket at the end of the >constructor of your RS232Port class that is one too much. Without >removing that bracket actually you cannot compile that file. After >removing that bracket I compiled both files attached to your message >and ran Test.java as well . The message reported by it was: > ># java Test > >Found my port :/dev/ttyS0 >No Error > >Is it what you expect without any device connected to the port? > >Gopal Krishan >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From lau2468 at hotmail.com Thu Feb 10 17:44:23 2005 From: lau2468 at hotmail.com (Alex Lau) Date: Thu, 10 Feb 2005 16:44:23 -0800 Subject: [Rxtx] Need some experienced JAVA programmer's advice In-Reply-To: Message-ID: Thanks Trent , Problem solved, the String.getBytes() does not do what I expected. I had to send a (byte)0x64 instead of using the String function. This is really an great mailing list. Alex >From: Trent Jarvi <taj at www.linux.org.uk> >Reply-To: Java RXTX discussion <rxtx at linuxgrrls.org> >To: Java RXTX discussion <rxtx at linuxgrrls.org> >Subject: Re: [Rxtx] Need some experienced JAVA programmer's advice >Date: Thu, 10 Feb 2005 09:00:35 +0000 (GMT) >MIME-Version: 1.0 >Received: from mail.linuxgrrls.org ([212.18.228.66]) by MC6-F19.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 10 Feb 2005 01:00:56 -0800 >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 05C0774644; Thu, 10 Feb 2005 08:59:40 +0000 (GMT) >Received: from hex.linuxgrrls.org (localhost [127.0.0.1])by mail.linuxgrrls.org (Postfix) with ESMTP id 52B2774646;Thu, 10 Feb 2005 08:59:35 +0000 (GMT) >Received: by mail.linuxgrrls.org (Postfix, from userid 1006)id 6A20374644; Thu, 10 Feb 2005 08:59:33 +0000 (GMT) >Received: from parcelfarce.linux.theplanet.co.uk(parcelfarce.linux.theplanet.co.uk [195.92.249.252])by mail.linuxgrrls.org (Postfix) with ESMTP id 5B7B57463Efor <rxtx at linuxgrrls.org>; Thu, 10 Feb 2005 08:59:30 +0000 (GMT) >Received: from [127.0.0.1] (helo=localhost)by parcelfarce.linux.theplanet.co.uk with esmtp (TLSv1:AES256-SHA:256)(Exim 4.33) id 1CzABg-0003Oa-3Jfor rxtx at linuxgrrls.org; Thu, 10 Feb 2005 09:00:36 +0000 >X-Message-Info: QIy1oIULmHdVsNv1ebmXFoFVUjn8DC0he2Df1B0wACg= >X-Original-To: rxtx at linuxgrrls.org >Delivered-To: rxtx at linuxgrrls.org >X-X-Sender: taj at parcelfarce.linux.theplanet.co.uk >References: <BAY18-F8F46D5E8B8F99BF4FE87CBF760 at phx.gbl> >X-BeenThere: rxtx at linuxgrrls.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: Java RXTX discussion <rxtx.linuxgrrls.org> >List-Unsubscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=unsubscribe> >List-Archive: <http://mailman.electronpusher.org/pipermail/rxtx> >List-Post: <mailto:rxtx at linuxgrrls.org> >List-Help: <mailto:rxtx-request at linuxgrrls.org?subject=help> >List-Subscribe: <http://mailman.linuxgrrls.org/mailman/listinfo/rxtx>,<mailto:rxtx-request at linuxgrrls.org?subject=subscribe> >Errors-To: rxtx-bounces at linuxgrrls.org >X-Spam-Checker-Version: SpamAssassin 3.0.2-gr1 (2004-11-16) on hex.linuxgrrls.org >X-Spam-Level: >X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.0.2-gr1 >Return-Path: rxtx-bounces at linuxgrrls.org >X-OriginalArrivalTime: 10 Feb 2005 09:00:58.0068 (UTC) FILETIME=[092CA140:01C50F4F] > >On Thu, 10 Feb 2005, Alex Lau wrote: > > > I wrote a wrapper class for working with the serial port using commapi > > > > I also wrote a driver program to test the wrapper class. The hardware I used > > is a DMM with serial output with communication specification 7,N,2 B600. To > > recieive a message, first send the DMM a 'd' command. > > > > The program suppose to send a 'd' to the DMM, read input from inputstream > > and display message to the console. But it does not work as expected. > > > > If anybody has some spare time, can you check the code in the attached files > > and give me some advices. > > > > Thanks in advance > > > > > >Is it 0x0d or 0x64 that you really want to send? See man ascii. > >There is an example program in contrib called SimpleSnuV1.java that sends >specific bytes to a modem. Maybe you could start with getting that to >talk to the DMM as a more simple test. Java Strings have 16 bit >characters for Unicode. The translation to bytes depends upon a few >things documented in the API documentation. > >-- >Trent Jarvi >taj at www.linux.org.uk >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From taj at www.linux.org.uk Tue Feb 15 12:28:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 15 Feb 2005 19:28:42 +0000 (GMT) Subject: [Rxtx] Trouble exucuting program using RXTX In-Reply-To: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> References: <001f01c50f4c$33e7fd60$4b00a8c0@testpc> Message-ID: On Thu, 10 Feb 2005, Vincent Ramp wrote: > I have a bit of a problem executing/distributing RXTX-2.1-7pre17 on windows. > > I built a small program with JBuilder9 to list my serial ports and when I run it with JBuilder, it runs perfectly and I get 4 com-ports and 2 LPT-ports. > > However, when I make an executable form it (using "Native executable builder"), and try to run the executable, the program hangs at GetPortIdentifiers(). Even the button using to call the function won't come up as long as I keep my mousecursor on top of it. > > I already set the classpath variable in MANIFEST.MF to RXTXcomm.jar and I did put the rxtxParallel.dll and rxtxSerial.dll in the same folder as the executable and in the system32 folder. > > I hope someone can help me with this. > > Thanks in advanced, > > Vincent Ramp Vincent found the solution to this: Hi, I found the problem, and I would like to share that with you. I did put the DLL's and the Jar file in the JRE folder of JbuilderJRE, but that is not the default folder JVM uses. When I put the files in the JRE of the currently used Java, all works perfect. Thanks for your support!! -- Trent Jarvi taj at www.linux.org.uk From jonwise at btinternet.com Wed Feb 16 14:46:33 2005 From: jonwise at btinternet.com (Jon) Date: Wed, 16 Feb 2005 21:46:33 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? Message-ID: <200502162146.33208.jonwise@btinternet.com> I have had a program running for several weeks reading Dallas 1-wire thermometers via RxTx and it has crashed the JVM every three or four hours on average. From some diagnostics, I could see the crash usually happened when a garbage collect was due. I have tried several releases without any significant difference. I am currently on rxtx-2.1-7pre17. Yesterday I made a one line change to force a garbage collect before a pause in processing and it has now run 24 hours without a crash, i.e. System.gc(); // line added to try to avoid jvm crash Thread.sleep(1000); Has anyone else had similar experience? Jon Wise From mikkal56 at hotmail.com Thu Feb 17 06:18:09 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 13:18:09 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> Message-ID: Hi, I have had the same problem with my aplication wich talks with an external card, it used to crash each 5 ot 6 hours, I changed everything, even almost they change me also jaja, I didi this but the problem persis but it crases each 93 or 124 hours ( i made a log with the cron), I did this, first I have the Rxtx SerialPort object in one instance wich was in memory all the time, but after I change this, now im using an static method wich open the opert and close it each time (each 3 seconds) , and I also call the garbage collector after each read to the serial port, really I didnt solve the problem nut the cron open up I made an scripts in perl for get up the application if it's procees id is gone, but this is not a real solution, i also send an email about this problem long time ago but nobody else had the same problem, ah I also forget it, this kind of crashes also happened to me when I have been using tomcat over an AMD about 2 years ago, it was the same problem, something that I can think is that the OS doesnt have the same libraries for intel than for AMD, maybe all the rest of the world are using intel with RXTX, I didnt probe it using the rxtx with Intel but like the most of the linux distros are ready for intel (i386) maybe I should recompile mi kernel to the specific micro, and also the java viertual machine says i386 (intel again) and Im using AMD !, well maybe it is the problem or maybe not. Like I told you I semi-solve the problem putting the port openning in a static method. P.S. Sorry about my english if I wrote something wrong im not an english speker. >From: Jon <jonwise at btinternet.com> >Reply-To: jonwise at btinternet.com,Java RXTX discussion <rxtx at linuxgrrls.org> >To: rxtx at linuxgrrls.org >Subject: [Rxtx] RxTx crashes due to garbage collect? >Date: Wed, 16 Feb 2005 21:46:33 +0000 > >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From krishan at dkrz.de Thu Feb 17 09:30:24 2005 From: krishan at dkrz.de (Gopal Krishan) Date: Thu, 17 Feb 2005 17:30:24 +0100 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <200502162146.33208.jonwise@btinternet.com> References: <200502162146.33208.jonwise@btinternet.com> Message-ID: <4214C6A0.8090107@dkrz.de> Jon wrote: >I have had a program running for several weeks reading Dallas 1-wire >thermometers via RxTx and it has crashed the JVM every three or four hours on >average. From some diagnostics, I could see the crash usually happened when a >garbage collect was due. I have tried several releases without any >significant difference. I am currently on rxtx-2.1-7pre17. > >Yesterday I made a one line change to force a garbage collect before a pause >in processing and it has now run 24 hours without a crash, i.e. > System.gc(); // line added to try to avoid jvm crash > Thread.sleep(1000); > >Has anyone else had similar experience? > >Jon Wise > >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > Hello everybody, I am using an older version of rxtx (released sometime in early 2003). The application runs for months in a stretch. It reads continuosly from two serial ports at 9600 baud; processing and storing data after the read and starting over again after a short pause so that the intervals between two reads are always equal. No problems caused by rxtx have been encountered since the launch in December 2003. Gopal Krishan From mikkal56 at hotmail.com Thu Feb 17 12:25:42 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Thu, 17 Feb 2005 19:25:42 +0000 Subject: [Rxtx] RxTx crashes due to garbage collect? In-Reply-To: <4214C6A0.8090107@dkrz.de> Message-ID: Hi, can give me the hardware expecificiation of the computer where tha software is running please ? tha CPU model, mainboard model, and also the linux distro, just to make sure wich could be the problem. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From lau2468 at hotmail.com Sat Feb 19 13:30:35 2005 Fr